let api_config = {
    list: { url: "/system/user/list", method: "get" },
    add: { url: "/system/user", method: "get" },
    delete: { url: "/system/post/{id}", method: "delete", id_field: "userId", },
    edit: { url: "/system/user", method: "put",id_field: "userId",is_query_detail: 1 },
    detail: { url: "/system/user/{userId}", method: "get", id_field: "userId", },
}

let column_params = {
    "deptId": '',
    "email": '',
    "introduction": '',
    "nickName": '',
    "password": '',
    "phonenumber": '',
    "postIds": '',
    "roleIds": '',
    "sex": '',
    "status": '',
    "userName": '',
}

let columns = [{"sort_in_form":"1","field":"nickName","
field_title":"昵称","table_width":"auto","table_render_type":"text","form_render_type":"input","is_hidden_in_table":false,"is_hidden_in_form":false,"is_required_in_form":true},{"sort_in_form":"2","field":"deptId","
field_title":"部门","table_width":"auto","table_render_type":"text","form_render_type":"treeSelect","is_hidden_in_table":false,"is_hidden_in_form":false,"is_required_in_form":true},{"sort_in_form":"3","field":"phonenumber","
field_title":"手机号","table_width":"auto","table_render_type":"text","form_render_type":"input","is_hidden_in_table":false,"is_hidden_in_form":false,"is_required_in_form":true},{"sort_in_form":"4","field":"email","
field_title":"邮箱","table_width":"auto","table_render_type":"text","form_render_type":"input","is_hidden_in_table":false,"is_hidden_in_form":false,"is_required_in_form":true},{"sort_in_form":"5","field":"userName","
field_title":"用户名称","table_width":"auto","table_render_type":"text","form_render_type":"input","is_hidden_in_table":false,"is_hidden_in_form":false,"is_required_in_form":true},{"sort_in_form":"6","field":"password","
field_title":"密码","table_width":"auto","table_render_type":"text","form_render_type":"input","is_hidden_in_table":false,"is_hidden_in_form":false,"is_required_in_form":true},{"sort_in_form":"7","field":"sex","
field_title":"性别","table_width":"auto","table_render_type":"text","form_render_type":"radio","is_hidden_in_table":false,"is_hidden_in_form":false,"is_required_in_form":true},{"sort_in_form":"8","field":"status","
field_title":"账号状态","table_width":"auto","table_render_type":"text","form_render_type":"radio","is_hidden_in_table":false,"is_hidden_in_form":false,"is_required_in_form":true},{"sort_in_form":"9","field":"postIds","
field_title":"岗位组","table_width":"auto","table_render_type":"text","form_render_type":"select","is_hidden_in_table":false,"is_hidden_in_form":false,"is_required_in_form":true},{"sort_in_form":"10","field":"roleIds","
field_title":"角色组","table_width":"auto","table_render_type":"text","form_render_type":"select","is_hidden_in_table":false,"is_hidden_in_form":false,"is_required_in_form":true},{"sort_in_form":"11","field":"introduction","
field_title":"个人简介","table_width":"auto","table_render_type":"text","form_render_type":"input","is_hidden_in_table":false,"is_hidden_in_form":false,"is_required_in_form":true}];

let table_columns = columns.filter(v => !v.is_hidden_in_table).map(v => ({
    ...v
}))
// [
//     // {
//     //     column: "postId",//字段属性名
//     //     field_title: "ID",//字段标题
//     //     table_width: "auto",//表格宽度
//     //     column_sortable: false, //表格是否可排序
//     //     column_show_overflow_tooltip: false, //表格悬浮是否展示提示
//     //     table_render_type: '',//表格展示类型   '' || text || tag || image || image-list || file
//     // },
// ]

let form_fields = columns.filter(v => !v.is_hidden_in_form).map(v => ({
    ...v
}))


// 表单默认值
let form_fields_default_value = {

}


// [
//     //【form_render_type 类型列表】
//     //input 默认
//     //number 文字输入
//     //textarea 文本域
//     //date 日期
//     //select 下拉选
//     //radio 单选
//     //cascader 级联选择
//     //upload-image 上传图片
//     //upload-file 上传文件
//     //rich-editor 富文本编辑器
//     //topic-card 话题卡片
//     {
//         column: "postId",
//         field_title: "ID",
//         is_required: 1,
//         form_render_type: "ID", //'' || text || tag || image || image-list || file

//         //选项型数据
//         // labelKey: "channelName",
//         // valueKey: "channelId",
//         // options: newsTypeOptions,

//         // 文件上传
//         // upload_multiple: true,
//         // upload_limit: 9,
//         // upload_tip: "(可上传多图，建议图片压缩后上传)",
//         // cache_key: "upload_cover_list", //图片上传回显
//         // saveFormat: "jsonObjectArray",
//     },
// ]


console.log('字段配置 columns', JSON.parse(JSON.stringify(columns)))
console.log('表格配置 table_columns', JSON.parse(JSON.stringify(table_columns)))
console.log('表单配置 form_fields', JSON.parse(JSON.stringify(form_fields)))


let table_row_actions = [
    { title: '编辑', },
    { title: '删除', },
    // {
    //   title: '更多',
    //   child: [
    //     {
    //       title: "设为热搜",
    //     },
    //     {
    //       title: "查看评论",
    //     },
    //   ]
    // },
]



let radio_options_map = {
    status: [
        {
            title: '正常',
            value: 0,
            type: '',
        },
        {
            title: '停用',
            value: 1,
            type: 'info',
        },
    ],
    sex: [
        {
            title: '男',
            value: 0,
            type: '',
        },
        {
            title: '女',
            value: 1,
            type: 'info',
        },
    ]

}





export default {
    api_config,
    
    table_columns,
    
    form_fields,
    form_fields_default_value,
    table_row_actions,
    radio_options_map,
};
